//----------------------------------------------------------------------------
// M A R I T I M E  R E S E A R C H  I N S T I T U T E  N E T H E R L A N D S
//----------------------------------------------------------------------------
// Copyright (C) 2012 - MARIN - All rights reserved - http://www.marin.nl
//----------------------------------------------------------------------------
// Program    : mermaid
// Module     : vbm
// File       : wavebreaking.h
// Author     : M.A. de Jong
//----------------------------------------------------------------------------

#ifndef WAVEBREAKING_H
#define WAVEBREAKING_H

#include "kernels/wavebreaking_kernels.h"

namespace wavescomputer
{

template <class T>
inline void wavebreaking(T* zeta_std,
                         T* alfa_brk,
                         const T* zeta,
                         const SHORT* wet,
                         const T* h0,
                         const T zeta_mean,
                         const T tau_brk,
                         const T dt,
                         const int nx,
                         const int ny)
{
    dimGrid.x = nx / NUM_THREADS_X;
    dimGrid.y = ny / NUM_THREADS_Y;
    dimBlock.x = NUM_THREADS_X;
    dimBlock.y = NUM_THREADS_Y;
        
    kernel_wavebreaking<T> <<< dimGrid, dimBlock >>> 
        (zeta_std,
         alfa_brk,
         zeta,
         wet,
         h0,
         zeta_mean,
         tau_brk,
         dt,
         nx);

    checkCudaError(cudaGetLastError(), 
        "wavescomputer::kernel_wavebreaking");
}

} // namespace wavescomputer

#endif // WAVEBREAKING_H

